#ifndef _RADIAN_EDITOR_ENGINE_H_
#define _RADIAN_EDITOR_ENGINE_H_

#include "RadianCommon.h"
#include "OgreSingleton.h"

/* RadianEditorEngine is core frame of the editor.
   It handles all the Ogre initialize stuffs,resources full management,and other basic management.
*/
class RadianEditorEngine : public Ogre::Singleton<RadianEditorEngine>
{

public:
	RadianEditorEngine(void);
	~RadianEditorEngine(void);

public: 
	static RadianEditorEngine* getSingletonPtr();
	static RadianEditorEngine& getSingleton();


	/* Initialize the engine.
	*/
	void InitializeEngine();

	/* Load and initialize resources.
	*/
	void InitializeResources();

	/* Config.
	*/
	bool Config();

	/* Run the engine.
	*/
	void Run();

	/* Set the engine to real-time mode.
	*/
	void SwitchRealTimeMode() { mIsRealtimeMode = !mIsRealtimeMode;}

	/* Get if the engine is in real-time mode.
	*/
	bool GetIsRealTimeMode() { return mIsRealtimeMode; }
		
	/* Tick Engine.
	*/
	void TickEngine();
	

public: 
	Ogre::Root* mRoot;												// editor's root.
	RadianResourceLoadingListener* mRadianResLoadingListener;		// resource load listener.
	bool mIsRealtimeMode;
};
#endif